#' Threshold Test and ADF Test Show
#' @param countryrlt a list which include 33 countries

Hansen99 <- function(countryrlt){
  ThrTest <- NULL
  ADFtest <- NULL
  for (i in 1:length(countryrlt)) {
    ADFtest <- rbind(ADFtest,countryrlt[[i]]$ADFtest)
    ifelse(length(countryrlt[[i]]$rawrlt) == 0,
           ThrTest <- data.frame(cnt = names(countryrlt)[i], regime = '阈值非线性',
                                 LR = countryrlt[[i]]$LR,
                                 pvalue = countryrlt[[i]]$pvalue) %>% rbind(ThrTest,.),
           ThrTest <- data.frame(cnt = names(countryrlt)[i], regime = '线性',
                                 LR = countryrlt[[i]]$LR,
                                 pvalue = countryrlt[[i]]$pvalue) %>% rbind(ThrTest,.))

  }
  # xlsx::write.xlsx(ThrTest,'../RltPaper/ThresholdTest.xlsx','Sheet2',append = T,row.names = FALSE)
  return(list(ThrTest = ThrTest, ADFtest = ADFtest))
}


